﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Shop_Inventory_Management
{
    #region Public Enumerations
    public enum CommandMode { Synchron, Update }
    #endregion

    public partial class Form1 : Form
    {
        private Controller.CoordinatingController CC = Controller.CoordinatingController.getInstance();

        public Form1()
        {
            InitializeComponent();
        }

        private void buttonSynchronize_Click(object sender, EventArgs e)
        {
            if (CC.StartOperation(CommandMode.Synchron))
                MessageBox.Show(this, "Synchronization is sucessful", "Synchronization", MessageBoxButtons.OK, MessageBoxIcon.Information);
            else
                MessageBox.Show(this, "Error in Synchronization", "Synchronization", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            if (CC.StartOperation(CommandMode.Update))
                MessageBox.Show(this, "Update price is sucessful", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
            else
                MessageBox.Show(this, "Error in Update price", "Update", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}
